/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package org.sbbs.admin.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Comment;
import org.hibernate.envers.AuditOverride;
import org.hibernate.envers.Audited;
import org.sbbs.base.jpa.entity.BaseAuditEntity;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

/**
 *
 * @author jenkins
 */
@Audited
@AuditOverride(forClass = BaseAuditEntity.class, isAudited = true)
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "sys_parameter", uniqueConstraints = {
    @UniqueConstraint(name="uk_sys_param_key" ,columnNames = "key_")})
@Comment("系统参数表")
@EntityListeners({AuditingEntityListener.class})
public class SysParameter extends BaseAuditEntity {

    private static final long serialVersionUID = 48474707901806632L;

    @Comment("KEY")
    @Column(name = "key_", length = 50,unique = true)
    @NotNull
    @Size(min = 2, max = 14)
    private String key;
    @Comment("名称")
    @Column(name = "name", length = 50)
    @NotNull
    @Size(min = 2, max = 14)
    private String name;
    @Comment("值")
    @Column(name = "value", length = 50)
    @NotNull
    private String value;
    @Comment("备注")
    @Column(name = "remark", length = 500)
    private String remark;

    @Column(name = "state")
    @NotNull
    private Boolean state;
}
